import openpyxl
import aweather

# openpyxl.workbook.Workbook() 创建新的工作簿
# workbook.create_sheet('景区天气') 创建新的表格
# sheet.append() 已有数据后添加一行数据
# workbook.save() 保存工作簿

html_str = aweather.get_html()
lst = aweather.parse_html(html_str)

workbook = openpyxl.workbook.Workbook()
sheet = workbook.create_sheet('景区天气')

for row in lst:
    sheet.append(row)

workbook.save('景区天气.xlsx')
